//
//  WJWeatherCollectionViewCell.m
//  天气
//
//  Created by dllo on 16/8/23.
//  Copyright © 2016年 WJ. All rights reserved.
//

#import "WJWeatherCollectionViewCell.h"
#import "WJImageView.h"
#import "WJTitleLable.h"


@interface WJWeatherCollectionViewCell ()

@property (nonatomic, strong) WJTitleLable *temperatureLable;
@property (nonatomic, strong) WJImageView *weatherPic;
@property (nonatomic, strong) WJTitleLable *timeLable;

@end

@implementation WJWeatherCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
       
        [self createView];
    }
    return self;
}


- (void)createView
{
    self.temperatureLable = [[WJTitleLable alloc]initWithFrame:CGRectMake(5, 0, 40, 20)];
    [self.contentView addSubview:self.temperatureLable];
    
    self.weatherPic = [[WJImageView alloc]initWithFrame:CGRectMake(10, 40, 20, 20)];
    [self.contentView addSubview:self.weatherPic];

    self.timeLable = [[WJTitleLable alloc]initWithFrame:CGRectMake(0, 80, 40, 20)];
    [self.contentView addSubview:self.timeLable];
    
}


- (void)setDic:(NSDictionary *)dic
{
    _dic = dic;
    
    self.temperatureLable.text = [NSString stringWithFormat:@"%@°",dic[@"temperature"]];
    
    self.weatherPic.image = [WJImageView imageWithName:dic[@"info"] hour:dic[@"hour"]];
    
    self.timeLable.text = [NSString stringWithFormat:@"%@:00",dic[@"hour"]];
    
}





















@end
